function submitModify() {
	var name = $.trim($("#name").val());
	var type = $.trim($("#type").val());
	var fee = $.trim($("#fee").val());
	var no = $.trim($("#no").val());
	var memo = $.trim($("#memo").val());
	var usefulfee = $.trim($("#usefulfee").html());
	var oemusefulfee = $.trim($("#oemusefulfee").html());
	var isoem = $.trim($("#isoem").val());
	if (name == "" || usefulfee == "" || oemusefulfee == "") {
		alert("请输入正确的经销商账号！");
		return;
	}
	if (isoem == 1 && fee < 0 && fee + oemusefulfee < 0) {
		alert("OEM余额不足，无法扣除！");
		return;
	}
	$.ajax({
		type : 'POST',
		url : "/financial/feeadjust.json",
		dataType : "json",
		data : {
			name : name,
			type : type,
			fee : fee,
			no : no,
			memo : memo
		},
		success : function(data) {
			if (data && data.ok) {
				alert("操作成功 ！");
				window.location.reload();
			} else {
				alert(data.msg);
			}
		},
		error : function(error) {
			alert("操作失败！");
		}
	});
}

function checkname() {
	var name = $.trim($("#name").val());
	if (name == "") {
		alsert("请输入正确的经销商账号！");
		return;
	}
	$("#usefulfee").html('');
	$("#isoem").html('');
	$("#oemusefulfee").html('');
	$.ajax({
		type : 'POST',
		url : "/financial/feequery.json",
		dataType : "json",
		data : {
			name : name
		},
		success : function(data) {
			if (data && data.ok) {
				$("#usefulfee").html(data.msg.split('|')[0]);
				$("#isoem").html(data.msg.split('|')[1]);
				$("#oemusefulfee").html(data.msg.split('|')[2]);
			} else {
				alert(data.msg);
			}
		},
		error : function(error) {
			alert("经销商账号输入错误！");
		}
	});
}
